home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
program
/
n_b_v203.zip
/
STR-MATH.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
3KB
|
67 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1996-02-08 ╟─╖
│ │ FILE NAME STR-MATH.DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
$STRING 32
$INCLUDE "DAS-NB03.INC"
COLOR 7, 0
CLS
? "┌───────────────────────────────────────────────────────────────────────
? "│ fADDnbr$( N1$, N2$ ) ' equiv: N1$ + N2$
? "│ fSUBnbr$( N1$, N2$ ) ' equiv: N1$ - N2$
? "│ fMULnbr$( N1$, N2$ ) ' equiv: N1$ * N2$
? "│ fDIVnbr$( N1$, N2$, Decs% ) ' equiv: N1$ / N2$ to Decs% places
? "├───────────────────────────────────────────────────────────────────────
? "│ These 4 functions provide mathematical services for extremely large,
? "│ small, or precise unreal numbers. You can have over 32,000 digits.
? "└───────────────────────────────────────────────────────────────────────
N1$ = "0.7827" : N1# = VAL( N1$ )
N2$ = "234.9" : N2# = VAL( N2$ )
PRINT "N1$ = "; N1$
PRINT "N2$ = "; N2$
PRINT STRING$( 79, "─" )
PRINT "ADD..... DASoft = ";
PRINT fADDnbr$( N1$, N2$ )
N# = N1# + N2#
GOSUB PRINT_IT
PRINT "SUB..... DASoft = ";
PRINT fSUBnbr$( N1$, N2$ )
N# = N1# - N2#
GOSUB PRINT_IT
PRINT "MUL..... DASoft = ";
PRINT fMULnbr$( N1$, N2$ )
N# = N1# * N2#
GOSUB PRINT_IT
PRINT "DIV..... DASoft = ";
PRINT fDIVnbr$( N1$, N2$, 55 )
N# = N1# / N2#
GOSUB PRINT_IT
END
'─────────────────────────────────────────────────────────────────
PRINT_IT:
PRINT " PBasic = ";
PRINT LTRIM$( USING$( "+###.################", N# ) )
PRINT "========================"
RETURN